#{extends 'Admin.html'/}
#{set title:'Admin -> Input App' /}


<h1>Nhap ung dung</h1>
<div class="adminTitleIntro">Su dung de nhap 1 dung ung</div>

#{form @Apps.save(), class:"simpleForm", enctype:'multipart/form-data', id:"formTopic"}
<input type="hidden" value="${dto.id}" name="dto.id">

<p>
    <label> Language : </label>
    <input type="text" value="${lang}" name="dto.language" disabled="true">
</p>


<p>
    <label> Code : </label> <input type="text" value="${dto.code}" name="dto.code">
</p>

<p>
    <label> Title : </label> <input type="text" value="${dto.title}" name="dto.title">
</p>

<p>
    <label> Order : </label> <input type="text" value="${dto.order}" name="dto.order">
</p>

<p>
    <label> Brief : </label> <input type="text" size="300" value="${dto.brief}" name="dto.brief">
</p>

<p>
    <label> Belong to group : </label>
    #{if dto != null}
        #{select 'dto.groupCode', items:allGroupCodes, valueProperty:'code', labelProperty:'title', value:dto.groupCode/}
    #{/if}
    #{else}
        #{select 'dto.groupCode', items:allGroupCodes, valueProperty:'code', labelProperty:'title'/}
    #{/else}
</p>

<p>
    <label> Small photo: </label>
    <img src="@{User.getAppImage(dto.id)}" alt="">
    <br>
    <label>&nbsp;</label>
    <input type="file" name="dto.photo">
</p>

<br class="clearfloat">

<div class="controls">
    <input type="submit" value="Save" />
    <input type="button" value="Cancel" onclick="document.href = '/apps/list'"/>
</div>


#{/form}

#{if dto.id != null }
    #{form @delete(dto.id)}
    <p class="crudDelete">
        <input type="submit" value="&{'crud.delete', type.modelName}" />
    </p>
    #{/form}
#{/if}